


#ifndef _VIDEO_PLAYER_H_
#define _VIDEO_PLAYER_H_


#include "CircleBuf.h"
#include "define.h"

#include "H264Decoder.h"

class CVideoPlayer
{
public:
    CVideoPlayer(int bPlayback, ENUM_VIDEO_MODE videomode, CCircleBuf *pVideoBuf);
    ~CVideoPlayer();

	int Start();
	int Stop();

private:
    void StartPlayThread();
    static void* PlayThread(void* param);      
    void PlayProcess();
    void DataCallBack(jbyteArray jbuf, int type, int bufsize, int width, int height);

    CCircleBuf *m_pVideoBuf;
	pthread_t m_PlayThreadID;

	bool m_bPlayThreadRuning;
	JNIEnv *m_envLocal;
	jmethodID m_jmidVideoCallback;

	CH264Decoder *m_pH264Decoer;

	ENUM_VIDEO_MODE m_VideoMode;
    int m_bPlayback;

};

#endif